package com.ztesoft.report.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ztesoft.report.base.entity.BaseEntity;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 上传日志表
 * </p>
 *
 * @author y3tu
 * @since 2018-06-26
 */
@TableName("upload_log")
@Data
public class UploadLog extends BaseEntity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
	@TableId(value="id", type= IdType.INPUT)
	private Integer id;
    /**
     * 上传文件名称
     */
	@TableField("report_name")
	private String reportName;
    /**
     * 关联report表id
     */
	@TableField("report_id")
	private String reportId;
    /**
     * 分类：report_category表id
     */
	@TableField("report_category_id")
	private Integer reportCategoryId;
    /**
     * 账期 例201806
     */
	private String cycle;
    /**
     * report_upload表id
     */
	@TableField("report_upload_id")
	private Integer reportUploadId;
    /**
     * 上传路径
     */
	@TableField("upload_path")
	private String uploadPath;
    /**
     * 下载次数
     */
	@TableField("download_count")
	private Integer downloadCount;
    /**
     * 状态 00A:上传成功 00X:上传失败
     */
	private String status;
    /**
     * 失败原因
     */
	@TableField("error_msg")
	private String errorMsg;
	@TableField("create_time")
	private Date createTime;
	@TableField("update_time")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date updateTime;
	//方便打包传回前台
	@TableField(exist = false)
	private String reportCategoryName;
	@TableField(exist = false)
	private String reportUploadName;


	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "UploadLog{" +
			", id=" + id +
			", reportName=" + reportName +
			", reportId=" + reportId +
			", reportCategoryId=" + reportCategoryId +
			", cycle=" + cycle +
			", reportUploadId=" + reportUploadId +
			", uploadPath=" + uploadPath +
			", downloadCount=" + downloadCount +
			", status=" + status +
			", errorMsg=" + errorMsg +
			", createTime=" + createTime +
			", updateTime=" + updateTime +
			"}";
	}
}
